Skip to content

Visibility#3

Open
Butcher3Years wants to merge 4 commits intomainfrom
Visibility
Open

Visibility#3
Butcher3Years wants to merge 4 commits intomainfrom
Visibility

Conversation

@Butcher3Years
Copy link
Copy Markdown
Owner

Visibility in C++ (also called access control or access specifiers) determines who can access (read, write, call) the members (variables, functions, etc.) of a class.
There are three visibility levels in C++:
public
private
protected

TL;DR – One-line versions

public = "everyone can use this"
protected = "family only" (class + children)
private = "my private stuff – nobody else touches it"

These three keywords are the main tools for encapsulation in C++ – one of the core ideas of object-oriented programming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant